package com.example.entity;

import lombok.Data;

import java.util.Objects;

@Data
public class Plane {
    int plane_id;
    String p_model; //波音737-800、空客A320、波音787-9、空客A330、波音777-300ER
    String p_airline;
    String build_date;
    int plane_age;
    String WiFi;
    int capacity;
    int economy_seat;
    int first_seat;
    int business_seat;

    public String getFlight_id() {
        if (Objects.equals(p_airline, "南方航空公司")){
            return "CZ" + String.format("%05d", plane_id);
        }else if(Objects.equals(p_airline, "东方航空公司")){
            return "MU" + String.format("%05d", plane_id);
        } else if (Objects.equals(p_airline, "中国国际航空公司")) {
            return "CA" + String.format("%05d", plane_id);
        } else{
            return "N/A";
        }
    }
}
